package com.zhw.service.impl;

import com.zhw.mapper.DevPlanMapper;
import com.zhw.pojo.entry.DevPlan;
import com.zhw.pojo.vo.DevPlanVO;
import com.zhw.service.DevPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class DevPlanServiceImpl implements DevPlanService {

    @Autowired
    DevPlanMapper devPlanMapper;

    @Override
    public List<DevPlanVO> getByID(Integer id) {
        List<DevPlanVO> devPlanVOS = devPlanMapper.getByID(id);


        return devPlanVOS;
    }


    @Override
    public void add(DevPlan devPlan) {
        devPlan.setCreateDate(LocalDateTime.now());
        devPlan.setUpdateDate(LocalDateTime.now());
        devPlanMapper.add(devPlan);
    }

    @Override
    public void update(DevPlan devPlan) {
        devPlan.setUpdateDate(LocalDateTime.now());
        devPlanMapper.update(devPlan);
    }

    @Override
    public void deleteById(Integer id) {
        devPlanMapper.deleteByID(id);
    }
}
